<%--
 *  File:    DoctorSelectPop.jsp
 *  @Author: Kevinfan
 *  Date:    4/11/2011
 *
 *  Copyright (C) 2000 - 2012 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.DoctorSelectPop");  
  String strModuleName = "TDR";
  String strTableName = "v_doctorconfsummary";
  String contextPath = request.getContextPath();
%>
  

<%@ include file="/inc/PageDefault.inc" %>
<html>
<head>
<title>DoctorSelectPop</title>
<PageFlow:CheckPageFlow pageName="p_doctorsummarypop"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/FuncLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<%
  Vector doctors = (Vector)pageContext.getAttribute("doctors");
  if(doctors == null)
  {
    doctors = new Vector();
  }
%>

<script language="JavaScript">

function clickItem(id, name,code,hosdeptname)
{
  parent.setDoctor(id,name,code,hosdeptname);
  parent.hiddenFrm();
}

function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(frm,actionvalue,orderbyname);
  editform.action = "DoctorSelectPop.jsp?maxitem=8&<%= OvalTools.randomURL() %>&selectoption=<%=JspHelper.filterNull( request.getParameter("selectoption") )%>&strglobalpccodes=<%=JspHelper.filterNull( request.getParameter("strglobalpccodes") )%>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}

</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="frm" method="post">
<table width="100%" cellspacing="0" cellpadding="0" height="100%">
    <input type="hidden" name="pagename" value="p_doctorsummarypop">
    <input type="hidden" name="actionname">
    <custom:hidden property="hospitalid"></custom:hidden>
    <tr>
      <td valign="top">
        <table width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="summary_top"></td>
          </tr>
        </table>
        <table width="100%" cellspacing="0" cellpadding="0">
         <%@ include file="/inc/SummarySearch.inc" %>
        </table> 
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
	  <tr class="deepblue-left">
      <td class="title_center" width="1%">&nbsp;</td>
      <td class="title_center" width="25%">&nbsp;<a href="javascript:page_summary('orderby','doctorcode')"><%=label.getLabelName("L_DoctorCode")%></a></td>
      <td class="title_center" width="25%">&nbsp;<a href="javascript:page_summary('orderby','doctorname')"><%=label.getLabelName("L_DoctorName")%></a></td>
      <td class="title_center" width="49%">&nbsp;<a href="javascript:page_summary('orderby','hosdeptname')"><%=label.getLabelName("L_Departments")%></a></td>
     </tr>

     <%
        int i = 0;
        String strIsChecked = new String("Checked");
        String strClassType = new String();   
        Integer strdoctorId = null;
        String strDoctorName = "";    
        String strDoctorCode = ""; 
	    String strHosDeptName = "";	
     %>
     <logic:iterate id="doctor" collection="<%= doctors %>">                      
      
     <%
       HashMap orgMap = (HashMap)pageContext.getAttribute("doctor"); 
       if(i%2 == 1)
       {
         strClassType = "td-listrom";
       }else{                    
         strClassType = "";
       }
       if(i != 0)
       {          
         strIsChecked = "";
       }
       else
       {
         strdoctorId = (Integer)(orgMap.get("doctorid"));
         strDoctorName = (String)(orgMap.get("doctorname"));  
         strDoctorCode = (String)(orgMap.get("doctorcode"));  
	 	 strHosDeptName = (String)(orgMap.get("hosdeptname"));
       }  
              
       i++;        
     %>   
     <tr onmouseover="this.className='tr-over'" 
         onmouseout="this.className='<%=JspHelper.filterNull(strClassType)%>'"
         class="<%=JspHelper.filterNull(strClassType)%>"  
         onClick="javascript:radiotrue('selectItem<%=JspHelper.filterNull( i )%>'); 
                             clickItem('<%=JspHelper.filterNull( orgMap.get("doctorid") )%>', '<%= OvalTools.replaceQuot(orgMap.get("doctorname")) %>','<%= OvalTools.replaceQuot(orgMap.get("doctorcode")) %>', '<%=OvalTools.replaceQuot(orgMap.get("hosdeptname"))%>')">    
      <td> 
        <input id="selectItem<%=JspHelper.filterNull( i )%>" type="radio" name="selectOrg" class="normalradio"
               value="<%=JspHelper.filterNull( orgMap.get("orgid") )%>" <%=JspHelper.filterNull( strIsChecked )%>   onClick="javascript:clickItem('<%=JspHelper.filterNull(orgMap.get("orgid"))%>','<%=OvalTools.replaceQuot(orgMap.get("orgname"))%>', '<%= OvalTools.replaceQuot(orgMap.get("orgcode"))%>', '<%=OvalTools.replaceQuot(orgMap.get("shortname"))%>')">
      </td>
      <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( orgMap.get("doctorcode") )%></td>
      <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( orgMap.get("doctorname") )%></td>
      <td class="<%=JspHelper.filterNull( strClassType )%>">&nbsp;<%=JspHelper.filterNull( orgMap.get("hosdeptname") )%></td>
     </tr>
    </logic:iterate> 
         <%@ include file="/inc/SummaryActionPop.inc" %>
      </table>
      </td>
    </tr>
</table>
</form>
</body>
</html>


